package org.nf.web.common.converter;

import cn.hutool.core.date.DateUtil;
import org.nf.web.common.TypeConverter;

import java.time.LocalDate;

/**
 * @Author lzp
 * @Date 2024-05-19
 */
public class LocalDateConverter implements TypeConverter {
    @Override
    public boolean supports(Class<?> paramType) {
        return paramType.equals(LocalDate.class);
    }

    @Override
    public Object convert(String requestParam) {
        return DateUtil.parse(requestParam).toLocalDateTime().toLocalDate();
    }
}
